<template>
	<view class="mykehu">
		<myNav>
			<view slot="left" @click="back"><uni-icons type="closeempty" color="#fff"></uni-icons></view>
			<view class="center">我的客户</view>
		</myNav>
		<view class="top">
			<input v-model="para" type="text" value="" placeholder="输入手机号或者手机后四位" placeholder-style="font-size: 12px;" />
			<image class="quedingxxx" @click="searchedVistor" src="/static/all/my/qudao.png" mode=""></image>
			<image class="add" @click="goto(1)" src="../../static/all/wodekehu/add.png" mode=""></image>
		</view>
		<view class="center">
			<view class="center-list">
				<view class="left">
				<text>张三 130123456789</text>
						<view class="ca">必买</view>
						<view class="ca">必问</view>
				</view>
				<view class="right">
					状态: 跟进中
				</view>
			</view>
			<view class="center-list">
				楼盘: 信息 楼盘一号 在售
			</view>
			<view class="center-list">
				<text>2020-01-01 21:00 手机</text> <text>首次跟进</text>
			</view>
		</view>
		<view class="fenzhu">
			<view class="item-1">
				分组
				<uni-icons type="arrowdown"></uni-icons>
			</view>
			<view class="item-1">
				排序<uni-icons type="arrowdown"></uni-icons>
			</view>
			<view class="item-1">
				筛选<uni-icons type="arrowdown"></uni-icons>
			</view>
		</view>
		<view class="gundong">
			<view class="gundong-item " @click="gotoinfo(item)" v-for="item in 100" :key="item">
				张三 130123456789  楼盘:-------    2019-01-01 21:00
			</view>
		</view>
	</view>
</template>

<script>
import { mapMutations } from 'vuex';
import Prompt from '@/components/zz-prompt/index.vue';
import myNav from '../../components/mynav/mynav.vue';
import { searchedVistor } from '@/api/index.js';
import { MyShow } from '@/util/my.js';
export default {
	components: { myNav, Prompt },
	data() {
		return {
			para:""
		};
	},
	methods: {
		...mapMutations(['back']),
		async searchedVistor() {
			//去请求接口
			//  todo 字段自己填充吧
			// console.log('去请求接口');
			try {
				let reslut = await searchedVistor({
					para:this.para
				});
				//成功
				new MyShow('需要渲染的字段').tixing();
			} catch (e) {
				//TODO handle the exception
				new MyShow('需要渲染的字段').tixing();
			}
			
		},
		gotoinfo(val){
			uni.navigateTo({
				url:"./p11"
			})
		},
		goto(val) {
			switch (+val) {
				case 1:
					uni.navigateTo({
						url: './p10'
					});
					break;
				case 2:
					break;
				case 3:
					break;
				case 4:
					break;
				default:
					break;
			}
		}
	}
};
</script>

<style lang="scss">
@import './main.scss';
.myright {
	display: flex;
	flex-direction: column;
	image {
		width: 20px;
		height: 20px;
	}
	margin-top: 40px;
	align-items: center;
	color: #ffffff;
	text {
		margin-top: 5px;
	}
}
</style>
